const { clearTimeout } = require("timers");

function Bomb(name) {
    this.name=name;  
    this.start=()=> {
        id=setTimeout(() => {
           console.log(this.name+"is Bombing!!!!!!!!");
       },3000);    
   }
   this.clear= ()=> {
       clearTimeout(id);
       console.log(this.name+" stoped");
   }  
}
var id;
// Bomb.prototype.start=()=> {
//      id=setTimeout(() => {
//         console.log(this.name+"is Bombing!!!!!!!!");
//     },3000);    
// }
// Bomb.prototype.clear= ()=> {
//     clearTimeout(id);
//     console.log(this.name+" stoped");
// }
var b1=new Bomb("炸弹1");
var b2=new Bomb("炸弹2");
b1.start();
b1.start();
setTimeout(() => {
    b2.clear();
},1000);
